package chapter4.No4_1_使用reentrantLock类.demo1;

import java.util.concurrent.locks.ReentrantLock;

/**
 * !
 *
 * @author liujian
 * @version 2016/11/21 0021
 */
public class ServiceClass {
    ReentrantLock lock = new ReentrantLock();

    public void printValue() {
        lock.lock();
        for(int i = 0; i < 10; i++) {
            System.out.println(Thread.currentThread().getName()+" :"+i);
        }
        System.out.println("=======================");
        lock.unlock();
    }
}
